<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>FakeAjax</title>
</head>
<body>

<script type="text/javascript">
    window.onload = function (){
        let date = new Date();
        document.getElementById("currentTime").innerText=date.toLocaleDateString()+date.toLocaleTimeString();
    }
    function fun(){
        let value = document.getElementById("url").value;
        console.log(value);
        document.getElementById("iframePosition").src = value;
    }
</script>

<div>
    <span>现在的时间为：</span>
    <span id = "currentTime"></span>
    <p>请输入要加载的地址：</p>
    <p>
        <input type="text" id = "url" value = "https://www.baidu.com"/>
        <input type="button" value="提交" onclick="fun()"/>
    </p>
</div>

<div>
    <h3>加载页面位置：</h3>
    <iframe id="iframePosition" style="width: 100%;height: 400px"></iframe>
</div>
</body>
</html>